package cn.snowsoft.iot.module.warning.dal.dataobject.warning.config;

import cn.snowsoft.iot.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.time.LocalTime;


@Data
@EqualsAndHashCode(callSuper = true)
@TableName("warning_config")
public class WarningDO extends BaseDO {

    @TableId("id")
    private Long id;

    private String warningName;

    private String warningType;

    private Integer isEnable;

    private Integer priority;

    private Long productId;

    private String productCode;

    private String productName;

    private String whereType;

    private String actionProcessType;

    private int actionProcessValue;

    private String ruleExpression;

    private String ruleSql;

    private String ruleId;

    private int timeRange;

    private String timeType;

    private String equipmentCode;

    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime beginTime;

    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime endTime;

    private String cron;

    private int jobId;
    /**
     * 动作收敛
     */
    private String actionTimeType;

    /**
     * 动作收敛，时间值
     */
    private int actionTimeValue;

}